Optimal. Leaf size=36 \[ -\frac{\tanh ^{-1}\left (\frac{b \cos (x)-a \sin (x)}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0181187, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3074, 206} \[ -\frac{\tanh ^{-1}\left (\frac{b \cos (x)-a \sin (x)}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3074
Rule 206
Rubi steps
\begin{align*} \int \frac{1}{a \cos (x)+b \sin (x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{a^2+b^2-x^2} \, dx,x,b \cos (x)-a \sin (x)\right )\\ &=-\frac{\tanh ^{-1}\left (\frac{b \cos (x)-a \sin (x)}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}}\\ \end{align*}
Mathematica [A] time = 0.0251666, size = 38, normalized size = 1.06 \[ \frac{2 \tanh ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )-b}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.072, size = 35, normalized size = 1. \begin{align*} 2\,{\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}{\it Artanh} \left ( 1/2\,{\frac{2\,a\tan \left ( x/2 \right ) -2\,b}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.491015, size = 242, normalized size = 6.72 \begin{align*} \frac{\log \left (-\frac{2 \, a b \cos \left (x\right ) \sin \left (x\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt{a^{2} + b^{2}}{\left (b \cos \left (x\right ) - a \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}}\right )}{2 \, \sqrt{a^{2} + b^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.2085, size = 82, normalized size = 2.28 \begin{align*} -\frac{\log \left (\frac{{\left | 2 \, a \tan \left (\frac{1}{2} \, x\right ) - 2 \, b - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac{1}{2} \, x\right ) - 2 \, b + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{\sqrt{a^{2} + b^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]